package org.jeecg.modules.demo_test;

import com.baomidou.dynamic.datasource.annotation.DS;
import org.jeecg.modules.demo_test.service.impl.TestServiceImpl;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class Handle {
    public static String getSql(String type) {
        String var1 = null;

            if (type.equals("mysql")) {
                var1 = MessageFormat.format("select distinct table_name from information_schema.columns where table_schema = {0}", org.jeecgframework.codegenerate.generate.util.c.c(org.jeecgframework.codegenerate.a.a.f));
            }
            if (type.equals("oracle")) {
                var1 = " select distinct colstable.table_name as  table_name from user_tab_cols colstable order by colstable.table_name";

            }
            if (type.equals("postgresql")) {
                var1 = "select tablename from pg_tables where schemaname='public'";
            }
            if (type.equals("sqlserver")) {
                var1 = "select distinct c.name as  table_name from sys.objects c where c.type = 'U' ";
            }
        return var1;
    }

}
